def main():
    count=int(input())
    list_num=[None]*count
    for i in range(count):
        list_num[i]=[int(input())]
    aws=max(list_num)
    print(aws[0])
    for i in range(count):
        if list_num[i]==max(list_num):
            print(i+1)
        else:
            continue
main()